<template>
  <div id="bodgon">
       <h2>开牌设置</h2>
       <el-button  type="success" @click="dialogVisible = true">添加</el-button>
         <el-dialog
                title="提示"
                :visible.sync="dialogVisible"
                :before-close="handleClose">
                 <div class="gameList">
            <el-form ref="form" :model="form" label-width="80px" class="selectCard">
              <fieldset class="fields">
                <legend>1</legend>
                <el-select @change="changePP" v-model="msgAdd.card[0].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select @change="changePP" v-model="msgAdd.card[0].size" placeholder="请选择牌数">
                    <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>2</legend>
                <el-select v-model="msgAdd.card[1].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[1].size" placeholder="请选择牌数">
                     <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>3</legend>
                <el-select v-model="msgAdd.card[2].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[2].size" placeholder="请选择牌数">
                      <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>4</legend>
                <el-select v-model="msgAdd.card[3].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                   <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[3].size" placeholder="请选择牌数">
                    <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>5</legend>
                <el-select v-model="msgAdd.card[4].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[4].size" placeholder="请选择牌数">
                      <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>6</legend>
                <el-select v-model="msgAdd.card[5].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[5].size" placeholder="请选择牌数">
                      <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>7</legend>
                <el-select v-model="msgAdd.card[6].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[6].size" placeholder="请选择牌数">
                      <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>8</legend>
                <el-select v-model="msgAdd.card[7].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[7].size" placeholder="请选择牌数">
                     <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
               <fieldset class="fields">
                <legend>9</legend>
                <el-select v-model="msgAdd.card[8].suit" placeholder="请选择牌型" style="margin-bottom:5px;">
                    <el-option label="黑桃" value="3"></el-option>
                    <el-option label="红心" value="1"></el-option>
                    <el-option label="梅花" value="4"></el-option>
                    <el-option label="方块" value="2"></el-option>
                </el-select>
                 <el-select v-model="msgAdd.card[8].size" placeholder="请选择牌数">
                     <el-option label="1" value="1"></el-option>
                    <el-option label="2" value="2"></el-option>
                    <el-option label="3" value="3"></el-option>
                    <el-option label="4" value="4"></el-option>
                    <el-option label="5" value="5"></el-option>
                    <el-option label="6" value="6"></el-option>
                    <el-option label="7" value="7"></el-option>
                    <el-option label="8" value="8"></el-option>
                    <el-option label="9" value="9"></el-option>
                    <el-option label="10" value="10"></el-option>
                    <el-option label="J" value="11"></el-option>
                    <el-option label="Q" value="12"></el-option>
                    <el-option label="K" value="13"></el-option>
                </el-select>
              </fieldset>
              </el-form>
               
          </div>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="dialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="addCardWeb">确 定</el-button>
                </span>
           </el-dialog>
        <el-form ref="form" :model="form" label-width="80px" class="selectCard">
              <fieldset class="fields">
                <legend>开牌牌组</legend>
                 <div class="" style="width:400px;">
                    <div class="cardLeft"></div>
                    <div class="cardRight"></div>
                 </div>
              </fieldset>
              <fieldset class="fields" style="width:300px;height:350px;">
                <legend>用户下注展示</legend>
                 <div class="cLeft">
                <div style="display:flex;margin-bottom:20px;">
                  <el-input
                    placeholder="请输入内容"
                    v-model="input1">
                    <i slot="prefix" class="el-input__icon el-icon-search"></i>
                  </el-input>
                  <el-button type="primary" @click="searchConData"  icon="el-icon-search" round style="margin-left:20px;">搜索</el-button>
                </div>
                <!--查询弹出框-->
                <el-dialog title="收货地址" :visible.sync="dialogTableVisible">
                     <el-table
                         max-height="400"
                        :data="tableData11"
                        border
                        style="width: 100%">
                        <el-table-column
                        prop="date"
                        label="日期"
                        width="180">
                        </el-table-column>
                        <el-table-column
                        prop="name"
                        label="姓名"
                        width="180">
                        </el-table-column>
                        <el-table-column
                        prop="address"
                        label="地址">
                        </el-table-column>
                        <el-table-column label="操作">
                        <template slot-scope="scope">
                            <el-button
                            size="mini"
                            @click="handleEdit(scope.$index, scope.row)">添加</el-button>
                        </template>
                        </el-table-column>
                    </el-table>
                </el-dialog>
                 <el-table
                    :data="tableData3"
                    height="250"
                    border
                    style="width: 100%">
                    <el-table-column
                    prop="userId"
                    label="用户id"
                    width="65">
                    </el-table-column>
                    <el-table-column
                    prop="useName"
                    label="用户名"
                    width="70">
                    </el-table-column>
                     <el-table-column
                    prop="win"
                    label="红方赢"
                    width="80">
                    </el-table-column>
                     <el-table-column
                    prop="ping"
                    label="平局"
                    width="70">
                    </el-table-column>
                    <el-table-column
                    prop="zhuanWin"
                    label="蓝方赢">
                    </el-table-column>
                    
                </el-table>
               
                
             </div>
              </fieldset>
              <fieldset class="fields" style="width:200px;height:350px;">
                 <legend>下注胜区控制</legend>
                 <div class="cRight">
                        <el-radio @change="changeGameMethod" v-model="msg.winners" label="1">闲赢</el-radio>
                        <el-radio @change="changeGameMethod" v-model="msg.winners" label="2">平局</el-radio>
                        <el-radio @change="changeGameMethod" v-model="msg.winners" label="3">庄赢</el-radio>
                        <hr>    
                        <el-radio @change="changeGameMethodTwo" v-model="msg.handSuits" label="4">同花</el-radio>
                        <el-radio @change="changeGameMethodTwo" v-model="msg.handSuits" label="5">连牌</el-radio>
                        <el-radio @change="changeGameMethodTwo" v-model="msg.handSuits" label="6">对子</el-radio>
                        <el-radio @change="changeGameMethodTwo" v-model="msg.handSuits" label="7">同花连牌</el-radio>
                        <el-radio @change="changeGameMethodTwo" v-model="msg.handSuits" label="8">对A</el-radio>
                        <hr>
                        <el-radio @change="changeGameMethodThree" v-model="msg.winnerSuits" label="9">高排/一对</el-radio> 
                        <el-radio @change="changeGameMethodThree" v-model="msg.winnerSuits" label="10">两对</el-radio>
                        <el-radio @change="changeGameMethodThree" v-model="msg.winnerSuits" label="11">三条/顺子/同花</el-radio>
                        <el-radio @change="changeGameMethodThree" v-model="msg.winnerSuits" label="12">葫芦</el-radio>
                        <el-radio @change="changeGameMethodThree" v-model="msg.winnerSuits" label="13">金刚/同花顺/皇家</el-radio>
                </div>
              </fieldset>
        </el-form>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        websock: null,
          tableData11: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }],
          dialogTableVisible:false,
        //   imgAll:imgAll,
            tableData3: [{
                userId:'1',
                useName:'洋洋y',
                win:'154875',
                ping:'0',
                zhuanWin:'2133'
            },
            {
                userId:'1',
                useName:'洋洋y',
                win:'154875',
                ping:'0',
                zhuanWin:'2133'
            },
            {
                userId:'1',
                useName:'洋洋y',
                win:'154875',
                ping:'0',
                zhuanWin:'2133'
            },],
            
            msgAdd:{
                  "card": [
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                        {
                            "size": "1",
                            "suit": "1"
                        },
                    ],
                  "type": "string"
            },
            msg:{
                 handSuits: undefined,
                 winnerSuits: undefined,
                 winners: undefined,
                 type: "4"
                },
            msgSearch:{
                "msg": {
                    "handSuits": "1",
                    "poker": [
                    {
                        "a": true,
                        "size": "1",
                        "suit": "1"
                    }
                    ],
                    "winnerSuits": "1",
                    "winners": "1",
                    'user':{
                        'username':'',
                        'userCode':''
                    }
                },
                 "type": "searchUser"
                },
          pokerMiddle:{},
          imgsAll:[],
          dataAll:[
              [
                   {
                        "a": true,
                        "size": "1",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "2",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
                     {
                        "a": true,
                        "size": "3",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "2",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
                    {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
              ],
               [
                   {
                        "a": true,
                        "size": "1",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "2",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
                     {
                        "a": true,
                        "size": "3",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "2"
                    },
                     {
                        "a": true,
                        "size": "2",
                        "suit": "1"
                    },
                     {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
                    {
                        "a": true,
                        "size": "1",
                        "suit": "4"
                    },
              ],
          ],
          
          websock: null,
          radio:'',
          data:[
            {id:'1',img:'555'},
            {id:'2',img:'555'},
            {id:'3',img:'555'},
            {id:'4',img:'555'},
            {id:'5',img:'555'},
         ],

        allCards:'',
        addCard:[
              {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
               {
                  suit:'1',
                  size:'1'
              },
              
          ],
          options: [{
          value: 'a',
          label: '黑桃',
          children: [{
            value: '1',
            label: '1',
          }]
        }, {
          value: 'b',
          label: '红心',
          children: [{
            value: '1',
            label: '1',
          }, {
            value: '2',
            label: '2',
          }, {
            value: '3',
            label: '3',
          }, {
            value: '4',
            label: '4',
          }, {
            value: '5',
            label: '5',
          }, {
            value: '6',
            label: '6',
          }, {
            value: '7',
            label: '7',
          },{
            value: '8',
            label: '8',
          },{
            value: '9',
            label: '9',
          },{
            value: '10',
            label: '10',
          },{
            value: '11',
            label: 'J',
          },{
            value: '12',
            label: 'Q',
          },{
            value: '13',
            label: 'K',
          },]
        }, {
          value: 'ziyuan',
          label: '资源',
          children: [{
            value: 'axure',
            label: 'Axure Components'
          }, {
            value: 'sketch',
            label: 'Sketch Templates'
          }, {
            value: 'jiaohu',
            label: '组件交互文档'
          }]
        }],
        radio2:3,
        tableData:'',
        checked:true,
        checkedTwo:true,
        dialogVisible: false,
        formInline: {
          user: '',
          region: ''
        },
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        allCard:'',
        input1:'',
        input2:'',
        input3:'',
        input4:'',
        input5:'',
        input6:'',
        input7:'',
        input8:'',
        input9:'',
      }
    },
    created(){
      this.initWebSocket()
    //   this.websocketsend(this.msg);
    },
    destroyed(){
        this.websocketclose()
    },
    methods: {
         handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
        // 添加牌组
        addCardWeb(){
            this.dialogVisible = false;
            if(typeof this.msgAdd=='string'){
                 this.msgAdd =  JSON.parse(this.msgAdd)
            }
             this.msgAdd.type = '1';
            console.log('RRRRRRRRRRRRRRRRr')
            console.log(this.msgAdd)
            // console.log(this.pokerMiddle)
            //  this.msgAdd.msg.setPoker = this.pokerMiddle;
            if(typeof this.msgAdd!='string'){
                 this.msgAdd =  JSON.stringify(this.msgAdd)
            }
            //  console.log('JJJJJJJJJJJJJJJJJJj')
            //  console.log(this.msgAdd)
            this.websocketsend(this.msgAdd);
        },
         changePP(){
            console.log(this.addCard[0])
        },
        // 
        handleEdit(){},
        //查询函数
        searchConData(){
           this.dialogTableVisible = true;
        },
        changeGameMethod(){
          if(typeof this.msg!='string'){
                 this.msg =  JSON.stringify(this.msg)
            }
            console.log(this.msg)
            this.websocketsend(this.msg);
        },
        changeGameMethodTwo(){
            if(typeof this.msg!='string'){
                 this.msg =  JSON.stringify(this.msg)
            }
            console.log('this.msg')
            console.log(this.msg)
            this.websocketsend(this.msg);
        },
        changeGameMethodThree(){
            console.log(this.msg)
            // console.log(this.changeGamethree)
            //   if(typeof this.msg=='string'){
            //      this.msg =  JSON.parse(this.msg)
            // }
            if(typeof this.msg!='string'){
                 this.msg =  JSON.stringify(this.msg)
            }
            console.log(this.msg)
            // console.log(this.changeGamethree.type)
            // console.log('this.msg')
            // console.log(this.msg)
            // console.log(this.msg.winnerSuits)
            // this.msg.winnerSuits = this.changeGamethree.type;
            // this.msg =  JSON.stringify(this.msg)
            // console.log('this.msg')
            // console.log(this.msg)
            this.websocketsend(this.msg);
        },
      threadPoxi(){  // 实际调用的方法
        //参数
        const agentData = "杨嘉敏";
        //若是ws开启状态
        if (this.websock.readyState === this.websock.OPEN) {
          this.websocketsend(agentData)
        }
        // 若是 正在开启状态，则等待300毫秒 
        else if (this.websock.readyState === this.websock.CONNECTING) {
          let that = this;//保存当前对象this
          setTimeout(function () {
            that.websocketsend(agentData)
          }, 300);
        }
        // 若未开启 ，则等待500毫秒
        else {
          this.initWebSocket();
          let that = this;//保存当前对象this
          setTimeout(function () {
            that.websocketsend(agentData)
          }, 500);
        }
      },
      initWebSocket(){ //初始化weosocket
        //ws地址
        const wsuri = 'ws://192.168.3.135:9875';
        this.websock = new WebSocket(wsuri);
        console.log('连接成功')
        this.websock.onmessage = this.websocketonmessage;
        this.websock.onclose = this.websocketclose;
      },
      websocketonmessage(e){ //数据接收
        var redata = JSON.parse(e.data);
        // 开牌牌组
        if(redata.type=='2'){
            console.log("222222222222")
            this.allCards = redata;
            console.log(this.allCards)
        }
        // 下注胜区控制
        if(redata.type=='4'){
            // if(typeof e.data=='string'){
                 this.msg =  redata
                 console.log('AAAAAAAAAAAAAAa')
                 console.log(this.msg)
            // }
        }
         if(redata.type=='1'){
             if(typeof e.data=='string'){
                 var aa =  JSON.parse(e.data)
            }
            console.log('this.allCards');
            // this.allCards = aa
            this.allCards = JSON.parse(aa.card)
            console.log(this.allCards);
            // console.log(aa.card);
            // console.log('NNNNNNNNNNNNNNNNN')
            // console.log(aa.card[0])
        }
      },
      websocketsend(agentData){//数据发送
        this.websock.send(agentData);
      },
      websocketclose(e){  //关闭
        console.log("connection closed (" + e.code + ")");
      },
      close(){
        this.websock.close(1000,'正常关闭')
      }
    },
    
  }
</script>
<style>
 #bodgon .el-dialog{
    width:600px;
}
   #bodgon .listImg{
    height:100px;
    overflow:hidden;
    width:100%;
    display:flex;
}
 #bodgon .listImg div{
    display:inline-block;
    width:60px;
}
 #bodgon img{
    display:block;
    width:50px!important;
    height:70px!important;
}
#bodgon .el-table__row{
    height:20px;
}
#bodgon .el-radio+.el-radio {
    margin-left: 0;
}
#bodgon .el-radio{
    width:100%;
}
#bodgon td{
    height:20px;
    padding:0;
}
#bodgon .el-table th{
    padding:0!important;
}
#bodgon .radioSty{
    height:70px;
    line-height:70px;
}

 #bodgon .Cradio{
    border:1px solid gray;
    width:180px;
    margin-top:10px;
    height:auto;
    padding:7px;
}
#bodgon .el-table_4_column_13{
    width:20px!important;
}



#bodgon .btnAdd{
    margin:10px 0 10px 18px;
    height:40px;
}
#bodgon .showIN{
    
  width:400px;
  font-size:16px;
  color:#606266;
  display:flex;
  flex-wrap:wrap;
  margin-right:0;
  display:none;
}
#bodgon .showINspan{
    display:inline-block;
    width:95px;
    height:20px;
    border-bottom:1px solid black;
}
#bodgon .cCenter{
    width:320px;
    margin-left:10px;
}
#bodgon .cLeft{
    width:370px;
}
#bodgon .cRight{
    width:200px;
    height:500px;
}
#bodgon .fields{
    height:120px;
}
#bodgon .field{
    width:80px!important;
    height:430px;
}
#bodgon .save{
    width:200px;
    float:right;
    margin-top:3px;
}
#bodgon .el-form-item__label{
    width:100px;
}

#bodgon{
    height:550px;
    width:1100px;
    padding:10px 20px 0 20px;
}
#bodgon .btnConfirm{
    margin:28px 20px 0 0;
    height:45px;
}
#bodgon .selectCard{
    display:flex;
    flex-wrap:wrap;
}
#bodgon fieldset{
    border-width:1px;
    border-color:white;
    width:150px;
    margin-bottom:5px;
    margin-right:10px;
}
#bodgon el-select{
    height:10px;
}
#bodgon .gameAll{
    display:flex;
    align-content:center;
    height:70px;
}
#bodgon .gameAll section{
    display:inline-block;
    height:40px;
    width:30px;
    border:1px solid #c0c4cc;
    margin:15px 3px 10px 0;
}
#bodgon .gameAll img{
    height:40px;
    width:30px;
}
#bodgon h2{
    margin:0;
    margin-bottom:5px;
}
 #bodgon .text {
    font-size: 14px;
  }
 #bodgon .item {
    padding: 18px 0;
  }
 #bodgon .box-card {
    width: 100%;
  }
 #bodgon .gameInputs{
      font-size:10px;
      padding:0 0!important;
      width:80px;
      height:40px;
      margin-right:1vw;
      margin-bottom:1vw;
  }
 #bodgon .gameList section{
      display:inline-block;
      text-align:center;
      border:1px solid #dcdfe6;
      border-radius:4px;
      position:relative;
      top:3px;
      width:50px;
      height:39px;
      line-height:40px;
       margin-right:1vw;
      margin-bottom:1vw;
  }
</style>